﻿//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define null ((void *)0)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define vmpt_real(type, p) ((type *)((vm->cpu->mem->buffer) + (p)))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define mr_ret(val) (vm->cpu->registers[0] = (val))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define mrst (vm->mem->mr_state)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define ARCH_VER ARCH_V_4
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define _bitm(v, a, b, size) (((v) << ((size) - (b)-1)) >> ((size) - (b)-1 + (a)))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bit1(v, a) (((v) >> (a)) & 0b1)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bitm64(v, a, b) _bitm(v, a, b, 64)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bitm(v, a, b) _bitm(v, a, b, 32)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bitm16(v, a, b) _bitm(v, a, b, 16)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bitm8(v, a, b) _bitm(v, a, b, 8)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define bitm4(v, a, b) _bitm(v, a, b, 4)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define val_bits(val) ((uint32)sizeof(val) << 3)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define sign_extend(val, val_bits) (((int32)((val) << (32 - (val_bits)))) >> (32 - (val_bits)))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define sign_extend_e(val) (((int32)((val) << (32 - val_bits(val)))) >> (32 - val_bits(val)))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_bm(from, to) bitm(inst, from, to)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_b1(pos) bit1(inst, pos)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_b4(from) inst_bm(from, from + 3)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_b8(from) inst_bm(from, from + 7)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_b16(from) inst_bm(from, from + 15)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define inst_b24(from) inst_bm(from, from + 23)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define println(fmt, ...) printf(fmt, ##__VA_ARGS__); printf("\n")
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define logd(fmt, ...) printf("[DEBUG] "); println(fmt, ##__VA_ARGS__)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define loge(fmt, ...) printf("[ERROR] "); println(fmt, ##__VA_ARGS__)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define logw(fmt, ...) printf("[WARN]  "); println(fmt, ##__VA_ARGS__)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define logi(fmt, ...) printf("[LOG]   "); println(fmt, ##__VA_ARGS__)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define loginst(name, hex) println("[INST]  name=%s, hex=0x%08x", name, hex)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define loginst(name, hex)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define lsl8(val, shift) ((uint8)(val) << (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define asl8(val, shift) ((int8)(val) << (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define lsr8(val, shift) ((uint8)(val) >> (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define asr8(val, shift) ((int8)(val) >> (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define ror8(val, shift) (lsr8(val, shift) | lsl8(val, (8 - (shift))))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define lsl16(val, shift) ((uint16)(val) << (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define asl16(val, shift) ((int16)(val) << (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define lsr16(val, shift) ((uint16)(val) >> (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define asr16(val, shift) ((int16)(val) >> (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define ror16(val, shift) (lsr16(val, shift) | lsl16(val, (16 - (shift))))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define lsl(val, shift) ((uint32)(val) << (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define asl(val, shift) ((int32)(val) << (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define lsr(val, shift) ((uint32)(val) >> (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define asr(val, shift) ((int32)(val) >> (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define ror(val, shift) (lsr(val, shift) | lsl(val, (32 - (shift))))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define lsl64(val, shift) ((uint64)(val) << (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define asl64(val, shift) ((int64)(val) << (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define lsr64(val, shift) ((uint64)(val) >> (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define asr64(val, shift) ((int64)(val) >> (shift))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define ror64(val, shift) (lsr64(val, shift) | lsl64(val, (64 - (shift))))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define regv(R) (st->registers[R])
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define even(num) (((num)&0x0001) == 0)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define cond_ok() check_cond(st, inst)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define has_reg_m4(reg) ((inst >> reg) & 0b0001)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define ldm_rn_pc_check() if (((inst >> 16) & 0x000f) == r_pc) return EXEC_UNPREDICTABLE
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define overflow_add(result, num1, num2) (((result) ^ (num1)) & ((result) ^ (num2)) & 0x80000000)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define overflow_sub(result, num1, num2) overflow_add(num1, result, num2)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define carry(result, num1) ((result) < (num1))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define carry8(res) ((res)&0x100)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define carry16(res) ((res)&0x10000)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define borrow8(res) ((res)&0x100)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define borrow16(res) ((res)&0x10000)


using System.Runtime.InteropServices;

//////[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
public partial struct mr_bitmap_t
{
	public ushort w;
	public ushort h;
	public uint buflen;
	public uint type;
	// uint16 *p;
	public uint buf;
}

//////[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
public partial struct mr_tile_t
{
	public short x;
	public short y;
	public ushort w;
	public ushort h;
	public short x1;
	public short y1;
	public short x2;
	public short y2;
	public ushort tilew;
	public ushort tileh;
}
//////[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
public partial struct mr_sound_t
{
	//    void*            p;
	public uint p;
	public uint buflen;
	public int type;
}
//////[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
public partial struct mr_sprite_t
{
	public ushort h;
}

/*
系统信息，这里的信息是可以被修改的。
*/
//public unsafe partial struct mr_sys_info_st
//{
//	/*
//		网络ID
//		0	移动
//		1	联动GSM
//		2	联通CDMA
//		3	未插卡
//	*/
//	public uint networkID;

//	public uint screen_width; //屏幕宽度
//	public uint screen_height; //屏幕高度
//	public uint screen_bits; //屏幕色深，24位

//	public fixed byte IMEI[16 + 1];// = new byte[16 + 1]; //IMEI
//	public fixed byte IMSI[16 + 1];//= new byte[16 + 1]; //IMSI
//	public fixed char manufactory[8 + 1];// = new string(new char[8 + 1]); //厂商名，最大7个字符，空字节填\0
//	public fixed char type[8 + 1];// = new string(new char[8 + 1]); //mobile type，最大7个字符，空字节填\0
//	public uint ver; //SW ver
//	public fixed byte spare[12 + 1]; //= new byte[12 + 1]; //备用

//	public fixed char sdcard_dir[DefineConstants.MAX_FILE_PATH_LEN];// = new string(new char[DefineConstants.MAX_FILE_PATH_LEN]); //SD卡目录
//	public fixed char dsm_dir[DefineConstants.MAX_FILE_PATH_LEN];// = new string(new char[DefineConstants.MAX_FILE_PATH_LEN]); //dsm目录，一般是mythroad啦

//}

/*
应用信息
*/
////[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
public unsafe partial struct mrc_appInfo_st
{
	public int id;
	public int ver;
	public uint sidName;
    public int ram;
}

/*
mrp运行过程中的一些状态
这些状态会被装在到虚拟机中，并可以被虚拟机访问
*/
//public unsafe partial struct mr_state_t
//{
//	/*
//	系统信息
//	这个信息需在虚拟机被创建之后mrp启动之前进行配置。
//	当函数表安装函数被调用时，这些信息的指针会被填写到函数表的位置，因为是指针，所以什么时候设置都可以用，只要是在mrp启动前就好。
//	*/
//	public GlobalMembers.mr_sys_info_st sysinfo;//= new mr_sys_info_st();
//	/*
//	从mrp文件中读取到内容+8的数据(也就是程序指令部分)，将该位置的内存指针存放在这里。
//	也就是说，这个函数是一个入口函数。
//	这个函数会在程序装在到内存之后进行设置。
//	原型: uint32 mr_c_function_load(uint32 code);
//	*/
//	public uint mr_c_function_load;
//	/*
//	这里存放的是mr_c_function_st结构的指针，当mr_c_function_new被调用时会分配该结构，并将指针放在此处。
//	*/
//	public uint mr_c_function_P;
//	public uint mr_c_function_P_Len; //也就是上面那个结构的长度啦。
//	/*
//	mr_c_function函数的指针
//	这个函数会在SWI_MR_C_FUNCTION_NEW中断发生时传递过来。
//	*/
//	public uint mr_c_function;
//	/*
//	注册固化列表，当调用mr_registerAPP函数时会往这里面填写
//	在初始化mr函数表的时候回被填写到c_internal_table的第0个位置
//	*/
//	public fixed uint mr_m0_files[DefineConstants.MRST_MAX_0FILES];// = new uint[DefineConstants.MRST_MAX_0FILES];
//	/*
//	这里面存储的是一些状态吧，有些不是太明白
//	*/
//	public fixed uint mr_c_internal_table[DefineConstants.MRST_INTERNAL_TABLE_MAX];// = new uint[DefineConstants.MRST_INTERNAL_TABLE_MAX];
//	public fixed uint mr_c_port_table[DefineConstants.MRST_INTERNAL_TABLE_MAX];// = new uint[DefineConstants.MRST_CPORT_TABLE_MAX];
//	/*
//	内存状态
//	在调用内存初始化函数的时候回填充此结构，并将此结构中的值填充到函数表的特定位置。
//	*/
//	public mr_mem_state_t mem_state;//= new mr_mem_state_t();

//	/*
//	包名称，在调用start_dsmX函数时填入，同样的，这两个名称也会映射到mr函数表中
//	*/
//	//public string pack_filename = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	//public string old_pack_filename = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	//public string start_filename = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	//public string old_start_filename = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	//public string start_file_parameter = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	//public string entry = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);

//	public fixed char pack_filename[DefineConstants.MR_FILE_MAX_LEN];// = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	public fixed char old_pack_filename[DefineConstants.MR_FILE_MAX_LEN];//= new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	public fixed char start_filename[DefineConstants.MR_FILE_MAX_LEN];//= new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	public fixed char old_start_filename[DefineConstants.MR_FILE_MAX_LEN];// = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	public fixed char start_file_parameter[DefineConstants.MR_FILE_MAX_LEN];// = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	public fixed char entry[DefineConstants.MR_FILE_MAX_LEN];// = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);

//	/*应用信息，在启动mrp的时候回填充此结构*/
//	public mrc_appInfo_st appInfo;// = new mrc_appInfo_st();

//	public uint mr_ram_file;
//	public uint mr_ram_file_len;

//	public fixed mr_bitmap_t mr_bitmap[DefineConstants.BITMAPMAX + 1];// = Arrays.InitializeWithDefaultInstances<mr_bitmap_t>(DefineConstants.BITMAPMAX + 1);
//	public mr_tile_t[] mr_tile = Arrays.InitializeWithDefaultInstances<mr_tile_t>(DefineConstants.TILEMAX);
//	public fixed uint mr_map[DefineConstants.TILEMAX];// = new uint[DefineConstants.TILEMAX];
//	public mr_sound_t[] mr_sound = Arrays.InitializeWithDefaultInstances<mr_sound_t>(DefineConstants.SOUNDMAX);
//	public mr_sprite_t[] mr_sprite = Arrays.InitializeWithDefaultInstances<mr_sprite_t>(DefineConstants.SPRITEMAX);

//	/*
//	下面这几个函数是由mrp通过testCom注册的
//	*/
//	public uint mr_event_function; //原型： (int32 code, int32 param0, int32 param1) -> int32
//	public uint mr_timer_function; //原型： (void) -> int32
//	public uint mr_stop_function; //原型： (void) -> int32
//	public uint mr_pauseApp_function; //原型： (void) -> int32
//	public uint mr_resumeApp_function; //原型： (void) -> int32

//	public mr_com_event_t com_param_event;//= new mr_com_event_t(); //testComC-事件处理参数

//	//一些标志状态
//	public sbyte mr_soundOn;
//	public sbyte mr_shakeOn;
//	public int bi;

//	public uint vm_state; //mrp_State*
//	public int mr_state;

//	public uint mr_timer_p; //void **
//	public int mr_timer_state;
//	public int mr_timer_run_without_pause;

//	public byte mr_sms_return_flag;
//	public int mr_sms_return_val;
//	public uint mr_sms_cfg_buf; //实际类型uint8*

//}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define vm_mem_offset(addr) ((uint8 *)(addr) - (uint8 *)(vm->cpu->mem->buffer))
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define vm_mem_buf (vm->cpu->mem->buffer)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define vmreg(i) (vm->cpu->registers[i])
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define vmstack(i) (*((uint32 *)(vm_mem_buf + vmreg(r_sp)) + i))

//public partial class mr_bitmap_t
//{
//	public ushort w;
//	public ushort h;
//	public uint buflen;
//	public uint type;
//	// uint16 *p;
//	public uint buf;
//}

//public partial class mr_tile_t
//{
//	public short x;
//	public short y;
//	public ushort w;
//	public ushort h;
//	public short x1;
//	public short y1;
//	public short x2;
//	public short y2;
//	public ushort tilew;
//	public ushort tileh;
//}

//public partial class mr_sound_t
//{
//	//    void*            p;
//	public uint p;
//	public uint buflen;
//	public int type;
//}

//public partial class mr_sprite_t
//{
//	public ushort h;
//}

///*
//系统信息，这里的信息是可以被修改的。
//*/
//public partial class mr_sys_info_st
//{
//	/*
//		网络ID
//		0	移动
//		1	联动GSM
//		2	联通CDMA
//		3	未插卡
//	*/
//	public uint networkID;

//	public uint screen_width; //屏幕宽度
//	public uint screen_height; //屏幕高度
//	public uint screen_bits; //屏幕色深，24位

//	public byte[] IMEI = new byte[16 + 1]; //IMEI
//	public byte[] IMSI = new byte[16 + 1]; //IMSI
//	public string manufactory = new string(new char[8 + 1]); //厂商名，最大7个字符，空字节填\0
//	public string type = new string(new char[8 + 1]); //mobile type，最大7个字符，空字节填\0
//	public uint ver; //SW ver
//	public byte[] spare = new byte[12 + 1]; //备用

//	public string sdcard_dir = new string(new char[DefineConstants.MAX_FILE_PATH_LEN]); //SD卡目录
//	public string dsm_dir = new string(new char[DefineConstants.MAX_FILE_PATH_LEN]); //dsm目录，一般是mythroad啦

//}

///*
//应用信息
//*/
//public partial class mrc_appInfo_st
//{
//	public int id;
//	public int ver;
//	public uint sidName;
//}

///*
//mrp运行过程中的一些状态
//这些状态会被装在到虚拟机中，并可以被虚拟机访问
//*/
//public partial class mr_state_t
//{
//	/*
//	系统信息
//	这个信息需在虚拟机被创建之后mrp启动之前进行配置。
//	当函数表安装函数被调用时，这些信息的指针会被填写到函数表的位置，因为是指针，所以什么时候设置都可以用，只要是在mrp启动前就好。
//	*/
////C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 TODO TASK: The typedef 'mr_sys_info_t' was defined in multiple preprocessor conditionals and cannot be replaced in-line:
//	public mr_sys_info_t sysinfo = new mr_sys_info_t();
//	/*
//	从mrp文件中读取到内容+8的数据(也就是程序指令部分)，将该位置的内存指针存放在这里。
//	也就是说，这个函数是一个入口函数。
//	这个函数会在程序装在到内存之后进行设置。
//	原型: uint32 mr_c_function_load(uint32 code);
//	*/
//	public uint mr_c_function_load;
//	/*
//	这里存放的是mr_c_function_st结构的指针，当mr_c_function_new被调用时会分配该结构，并将指针放在此处。
//	*/
//	public uint mr_c_function_P;
//	public uint mr_c_function_P_Len; //也就是上面那个结构的长度啦。
//	/*
//	mr_c_function函数的指针
//	这个函数会在SWI_MR_C_FUNCTION_NEW中断发生时传递过来。
//	*/
//	public uint mr_c_function;
//	/*
//	注册固化列表，当调用mr_registerAPP函数时会往这里面填写
//	在初始化mr函数表的时候回被填写到c_internal_table的第0个位置
//	*/
//	public uint[] mr_m0_files = new uint[DefineConstants.MRST_MAX_0FILES];
//	/*
//	这里面存储的是一些状态吧，有些不是太明白
//	*/
//	public uint[] mr_c_internal_table = new uint[DefineConstants.MRST_INTERNAL_TABLE_MAX];
//	public uint[] mr_c_port_table = new uint[DefineConstants.MRST_CPORT_TABLE_MAX];
//	/*
//	内存状态
//	在调用内存初始化函数的时候回填充此结构，并将此结构中的值填充到函数表的特定位置。
//	*/
//	public mr_mem_state_t mem_state = new mr_mem_state_t();

//	/*
//	包名称，在调用start_dsmX函数时填入，同样的，这两个名称也会映射到mr函数表中
//	*/
//	public string pack_filename = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	public string old_pack_filename = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	public string start_filename = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	public string old_start_filename = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	public string start_file_parameter = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);
//	public string entry = new string(new char[DefineConstants.MR_FILE_MAX_LEN]);

//	/*应用信息，在启动mrp的时候回填充此结构*/
////C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 TODO TASK: The typedef 'mrc_appInfo_t' was defined in multiple preprocessor conditionals and cannot be replaced in-line:
//	public mrc_appInfo_t appInfo = new mrc_appInfo_t();

//	public uint mr_ram_file;
//	public uint mr_ram_file_len;

//	public mr_bitmap_t[] mr_bitmap = Arrays.InitializeWithDefaultInstances<mr_bitmap_t>(DefineConstants.BITMAPMAX + 1);
//	public mr_tile_t[] mr_tile = Arrays.InitializeWithDefaultInstances<mr_tile_t>(DefineConstants.TILEMAX);
//	public uint[] mr_map = new uint[DefineConstants.TILEMAX];
//	public mr_sound_t[] mr_sound = Arrays.InitializeWithDefaultInstances<mr_sound_t>(DefineConstants.SOUNDMAX);
//	public mr_sprite_t[] mr_sprite = Arrays.InitializeWithDefaultInstances<mr_sprite_t>(DefineConstants.SPRITEMAX);

//	/*
//	下面这几个函数是由mrp通过testCom注册的
//	*/
//	public uint mr_event_function; //原型： (int32 code, int32 param0, int32 param1) -> int32
//	public uint mr_timer_function; //原型： (void) -> int32
//	public uint mr_stop_function; //原型： (void) -> int32
//	public uint mr_pauseApp_function; //原型： (void) -> int32
//	public uint mr_resumeApp_function; //原型： (void) -> int32

//	public mr_com_event_t com_param_event = new mr_com_event_t(); //testComC-事件处理参数

//	//一些标志状态
//	public sbyte mr_soundOn;
//	public sbyte mr_shakeOn;
//	public int bi;

//	public uint vm_state; //mrp_State*
//	public int mr_state;

//	public uint mr_timer_p; //void **
//	public int mr_timer_state;
//	public int mr_timer_run_without_pause;

//	public byte mr_sms_return_flag;
//	public int mr_sms_return_val;
//	public uint mr_sms_cfg_buf; //实际类型uint8*

//}
